USE [Master]
GO
IF NOT EXISTS(SELECT * from syslogins WHERE name='NT AUTHORITY\SYSTEM') 
BEGIN
  CREATE LOGIN [NT AUTHORITY\SYSTEM] FROM WINDOWS
END
GO
GRANT UNSAFE ASSEMBLY TO [NT AUTHORITY\SYSTEM]
GO
